Skip to content

fix: change to hashHistory urls to suppport subpaths#105

Merged
sbgap merged 1 commit into
masterfrom
routing
May 11, 2026
Merged

fix: change to hashHistory urls to suppport subpaths#105
sbgap merged 1 commit into
masterfrom
routing

Conversation

@sbgap
Copy link
Copy Markdown
Collaborator

@sbgap sbgap commented May 11, 2026

Description
Fix the problem with reloading pages with multiple "/" after using a relative base in the Vite config. Build did not generate the correct files to support paths with multiple "/" characters in nginx, so pages like "/alert/[id]" could not be manually accessed by typing the URL or by refreshing the page after navigating to it. Switching to hashHistory for routing fixes this problem by using hashRoutes, which are correctly handled by nginx. This adds a "/#/" to the front of all paths, changing the URL "http://localhost:3000/alerts" to "http://localhost:3000/#/alerts". When using a subpath like "alerta", it becomes "http://localhost:3000/alerta/#/alerts".

@sbgap sbgap merged commit 0468339 into master May 11, 2026
8 checks passed
@sbgap sbgap deleted the routing branch May 11, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant